package com.lrs.java.rmi.server;

import java.rmi.RemoteException;
import java.rmi.registry.LocateRegistry;
import java.rmi.registry.Registry;

public class HelloWorldServer {

	public static void main(String[] args) {
		try {
			HelloWorld hw = new HelloWorldImpl();
			//默认是1099端口
			Registry registry = LocateRegistry.getRegistry();
			registry.rebind("hw", hw);

			System.out.println("server start...");
		} catch (RemoteException e) {
			e.printStackTrace();
		}
	}
}
